<?php
/**
 * 此题无解 中转输入脚本 测试版
 *
 * @category   载入配置
 * @author      此题无解
 * 更多Web安全交流 Q群：260044099
 */

/*检测来源，不安全
$p_url = str_replace($_SERVER['PHP_SELF'],'SaveConfig.php','');
$t_port = $_SERVER['SERVER_PORT'] == 80?'/':':'.$_SERVER['SERVER_PORT'].'/';
$r_url = 'http://'.$_SERVER['HTTP_HOST'].$t_port.$p_url;
$search = stripos(@$_SERVER['HTTP_REFERER'], $r_url);
if ($search === false) {
	header("HTTP/1.1 404 Not Found");
	die();
};*/


include("common.php");
//处理提交的数据
//print_r($_POST);
$config = isset($_GET['config'])?$_GET['config']:'default';
$file = realpath('./config/').'/'.$config.'_config.xml';
if (!file_exists($file)) {
    echo json_encode(array('status'=>'no','info'=>'没有配置文件'));
    die();
}

$xml = simplexml_load_file($file);
$path = '/TransFormConfig/'.$config;
$xmlconfig = $xml->xpath($path);
$configarray = (array)$xmlconfig[0];
print_r($configarray);





?>